const LoginDao = require('../dao/login-dao')
const BaseServices = require('./base-service')

/**
 * 登录services
 */
class LoginServices extends BaseServices{
    constructor(dao = new LoginDao()) {
        super();
        this.dao = dao
    }
    add(obj) {
        super.add(obj);
    }

    /**
     * 用户名密码是否存在
     * @param username
     * @param password
     */
    hasExist(username,password) {
        return this.dao.hasExist(username,password)
    }

    /**
     * 获取用户信息
     * @param username
     * @param password
     * @returns {*}
     */
    getUser(username,password) {
        const RowsDataPackets = this.dao.getUser(username,password)
        console.log("service ====== RowsDataPackets:",RowsDataPackets)
        return RowsDataPackets
    }
}

module.exports = LoginServices;
